package cn.cs.service;

import cn.cs.mapper.UserAddressMapper;
import cn.cs.mapper.UserRepairApplyMapper;
import cn.cs.pojo.AppOrder;
import cn.cs.pojo.UserAddress;
import cn.cs.pojo.UserRepairApply;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@RestController
public class UserRepairApplyService {

    @Resource
    private UserRepairApplyMapper userRepairApplyMapper;

    @RequestMapping(value = "/getUserRepairApplyById", method = RequestMethod.POST)
    public UserRepairApply getUserRepairApplyById(@RequestParam("id") String id) throws Exception{
        return userRepairApplyMapper.getUserRepairApplyById(id);
    }

    @RequestMapping(value = "/getUserRepairApplyListByMap", method = RequestMethod.POST)
    public List<UserRepairApply> getUserRepairApplyListByMap(@RequestBody Map<String, Object> param) throws Exception{
        return userRepairApplyMapper.getUserRepairApplyListByMap(param);
    }

    @RequestMapping(value = "/getUserRepairApplyCountByMap", method = RequestMethod.POST)
    public Integer getUserRepairApplyCountByMap(@RequestBody Map<String, Object> param) throws Exception{
        return userRepairApplyMapper.getUserRepairApplyCountByMap(param);
    }

    @RequestMapping(value = "/insertUserRepairApply", method = RequestMethod.POST)
    public Integer insertUserRepairApply(@RequestBody UserRepairApply userRepairApply) throws Exception{
        return userRepairApplyMapper.insertUserRepairApply(userRepairApply);
    }

    @RequestMapping(value = "/updateUserRepairApply", method = RequestMethod.POST)
    public Integer updateUserRepairApply(@RequestBody UserRepairApply userRepairApply) throws Exception{
        return userRepairApplyMapper.updateUserRepairApply(userRepairApply);
    }

    @RequestMapping(value = "/deleteUserRepairApplyById", method = RequestMethod.POST)
    public Integer deleteUserRepairApplyById(@RequestParam("id") String id) throws Exception{
        return userRepairApplyMapper.deleteUserRepairApplyById(id);
    }

    @RequestMapping(value = "/getRepairUserByAreaIdOnlyWork", method = RequestMethod.POST)
    public List<Map<String, Object>> getRepairUserByAreaIdOnlyWork(@RequestParam("area") String area)throws Exception{
        return userRepairApplyMapper.getRepairUserByAreaIdOnlyWork(area);
    }



}
